import 'package:demo202112/utils/common_appbar.dart';
import 'package:flutter/material.dart';

/// @Author wywinstonwy
/// @Date 2022/1/27 8:29 上午
/// @Description: 


class WyProviderPage extends StatefulWidget {
  const WyProviderPage({Key? key}) : super(key: key);

  @override
  _WyProviderPageState createState() => _WyProviderPageState();
}

class _WyProviderPageState extends State<WyProviderPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: getAppBar('Provider'),
    );
  }
}

class InheritedProvider<T>extends InheritedWidget{
  final T data;
  const InheritedProvider({required  this.data,
  required Widget child}) : super(child: child);

  @override
  bool updateShouldNotify(covariant InheritedWidget oldWidget) {
    //在此简单返回true，则每次更新都会调用依赖其的子孙节点的`didChangeDependencies`。
    // throw UnimplementedError();
    return true;
  }
  
}